use strict;
use warnings;

use geneGenerator ;
use GSEA::FileReading::FileReader; 
use GSEA::ES::EScalculator; 
use GSEA::Chart::ChartCreator;

use GSEA::Pvalue::Permutor ;
use GSEA::Pvalue::PvalueCalculator;


for( my $i =0 ; $i < 20 ; $i++ )
{
	

my $gg = geneGenerator->constrGeneGenerator(100,".\\files\\file_1.txt" , 50 , ".\\files\\file_2.txt" );
$gg->generateFiles();


my $L_file_name = ".\\files\\file_1.txt" ;
my $S_file_name = ".\\files\\file_2.txt" ;


my $fileReader = GSEA::FileReading::FileReader->constrFileReader( $L_file_name, $S_file_name ) ;
my @L_table = $fileReader->read_Lfile();
my @S_table = $fileReader->read_Sfile();

my $Npermutations = 1000 ;
my $Pparameter = 1 ;


my $drawer = GSEA::Chart::ChartCreator->constrChartCreator(".\\graphout\\graphout.exe",800,800);

my $calculator = GSEA::ES::EScalculator->constrEScalculator( \@L_table , \ @S_table , $Pparameter );
$calculator->searchCommonGenes();
$calculator->CalculateEScourb();
my @data = $calculator->getCourb();

$drawer->drawEScourb( ".\\out\\line$i", \@data );


}
#
#@data = $calculator->getDistribution();
#$drawer->drawGeneSetDistribution(".\\out\\distribution" , \@data );
#


system(".\\out\\batch");
